#define FBEXT_NO_LIBZ -1

#include Once "../inc/map.bi"
#Include Once "../inc/gui.bi"
#include Once "../inc/gfx.bi"

extern curr_map as map
extern console as uinteger

Declare sub mainloop()

Dim curr_map As map

Dim as Uinteger console

console = freefile()


Chdir exepath
ScreenRes scr_x,scr_y,32

Open cons for output as #console

print #console, ">> Loading map.."
var ret = loadMap("dat/map1.map", curr_map)

if ret <> 0 then
   'some error loading the map
   sleep
   end
EndIf

print #console, ">> Loading gui.."
loadGui()


print #console, ">> Loading sprites.."
loadSprites()
print #console, ">> Main Loop.."
mainloop()

print #console, ">> Unloading Sprites.."
UnloadSprites()

print #console, ">> Unloading Gui.."
UnloadGui ()
print #console, ">> Unloading map.."
unloadMap (curr_map)

close #console


